/************************************************************
 * Project Name         [Thinking_In_Java]
 * File Name            [Java_IO_InputStreamReader.java]
 * Creation Date        [07-Jul-2014]
 * 
 * Copyright© ge.y.yang@gmail.com All Rights Reserved
 * 
 * Work hard, play harder, think big and keep fit
 ************************************************************/
package pkg_09_io.api;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 * java.io.InputStreamReader<br>
 * 
 * 用于读取控制台输入, 现在可以使用java.util.Scanner
 * 
 * 
 * @author 不落的太阳(Sean Yang)
 * @version 1.0
 * @since JDK 6
 * 
 */
public class Java_IO_InputStreamReader {

	/**
	 * 测试方法
	 * 
	 * @param args
	 *            命令行参数
	 */
	public static void main(String[] args) {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		try {
			String temp = br.readLine();
			while (temp != null) {
				if (temp.equals("byebye")) {
					break;
				} else {
					System.out.println("U just input: " + temp);
					temp = br.readLine();
				}
			}
		} catch (IOException e) {
			e.printStackTrace();
		} finally {
			try {
				br.close();
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
	}

}
